<?php

/**
 # com_jvframwork - JV Framework
 # @version		1.5.x
 # ------------------------------------------------------------------------
 # author    Open Source Code Solutions Co
 # copyright Copyright (C) 2011 joomlavi.com. All Rights Reserved.
 # @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL or later.
 # Websites: http://www.joomlavi.com
 # Technical Support:  http://www.joomlavi.com/my-tickets.html
-------------------------------------------------------------------------*/

// No direct access
defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.view');

class JVframeworkViewUpdate extends JView {

    function __construct($config = array()) {
        parent::__construct($config);
    }

    function display($tpl = null) { 
        $option = JFactory::getApplication()->get('scope');
        
        JSubMenuHelper::addEntry(JText::_('COM_JVFRAMEWORK_MANAGER_THEMES'), 'index.php?option=com_jvframework');
        JSubMenuHelper::addEntry(JText::_('COM_JVFRAMEWORK_MANAGER_UPDATE'), 'index.php?option=com_jvframework&c=update');      
        JToolBarHelper::title(JText::_('COM_JVFRAMEWORK_MANAGER_UPDATE'), 'help_header.png');
        
        $document =& JFactory::getDocument();   
        $document->addStyleSheet(JURI::base().'components/'.$option.'/assets/css/style.css'); 
        $document->addScript(JURI::base().'components/'.$option.'/assets/js/framework.js'); 
        JHTML::_('input.formValidation()',$option);
        JHTML::_('behavior.modal');
        
        $pKey       =& $this->get( 'Key' ); 
        $version    =  $this->get( 'CurrentVersion' );
        if(JFile::exists(JVPATH_BASETHEME.'version.ini') == false){
            //JError::raiseWarning('301', 'Update your basetheme, JV Framework 1.5.1.1 or newer have any change in basetheme, <a title="Click here to update basetheme" href="#" onclick="jvAdmin.updateBasetheme()">click here</a> to update basetheme !');
        }
         
        $typeoption = array(
			JHTML::_('input.option','suggestion', JText::_('Suggestion')),
			JHTML::_('input.option','bug', JText::_('Bug'))
		);        
        $relationoption = array(
			JHTML::_('input.option', 'configurator', JText::_('Configurator')),
			JHTML::_('input.option', 'inflexible', JText::_('Inflexible'))
		);
        
	    $var = array(  
            'SUBJECT'    => JHTML::_('input.textbox','COM_JVFRAMEWORK_FIELD_SUBJECT_LABEL','subject','','',array('required'=>true,'labelClass'=>'title')),
            'MESSAGE'    => JHTML::_('input.textarea','COM_JVFRAMEWORK_FIELD_MESSAGE_LABEL','message','','',array('required'=>true,'labelClass'=>'title')),
            'EMAIL'      => JHTML::_('input.textbox','COM_JVFRAMEWORK_FIELD_EMAIL_LABEL','email','','',array('required'=>true,'requiredOption'=>'validate["required","email"]','labelClass'=>'title')),
            'VER'        => $version,
            'TOKEN'      => JHTML::_('form.token'),
            'FORM_LINK'  => 'index.php?option='.$option.'&c='.JRequest::getWord('c'),
            'OPTION'     => $option,
            'PKEY'       => $pKey,
            
        );
        
        $this->assign($var);
        parent::display();
    }
    
}
